package com.gxa.modules.community.service.impl;

import com.gxa.modules.community.entity.AnnouncementList;
import com.gxa.modules.community.entity.CommunityAnnouncement;
import com.gxa.modules.community.mapper.CommunityAnnouncementMapper;
import com.gxa.modules.community.service.CommunityAnnouncementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CommunityAnnouncementServiceImpl implements CommunityAnnouncementService {
    @Autowired
    private CommunityAnnouncementMapper communityAnnouncementMapper;
    @Override
    public List<CommunityAnnouncement> querycommunityAnnouncement(Map<String,Object> params) {
        String readState = (String)params.get("readState");
        List<CommunityAnnouncement> communityAnnouncements=this.communityAnnouncementMapper.queryCommunityAnnouncement(readState);
        return communityAnnouncements;
    }

    @Override
    public List<AnnouncementList> announcementList(Map<String, Object> params) {
        String id = (String)params.get("id");
        List<AnnouncementList> announcementLists=this.communityAnnouncementMapper.announcementList(id);
        this.communityAnnouncementMapper.announcementUpdateReadState(id);
        return announcementLists;
    }
}
